class DocumetType < ActiveRecord::Base
  belongs_to :valleyer
  has_many :articles
  has_many :reships
  has_many :albums

  def many?
    if articles.length != 0 || reships.length != 0 || albums.length != 0
      return false
    else
      return true
    end
  end

  #系统中的所有分类
  def self.all_valleyer_id_is_not_null_documet_types
    DocumetType.all :conditions => "valleyer_id is not null",
      :order => "created_at desc"
  end
end
